package com.jingtai.platform.controller.merchants;

import com.jingtai.core.entity.merchants.MerchantsOfSupplyApply;
import com.jingtai.platform.service.merchants.MerchantsOfSupplyApplyService;
import com.jingtai.platform.util.ResultUtil;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import com.jingtai.validate.swagger.CApiParam;

/**
 * 商户向供应商申请商品表
 *
 * @author sunlaiqian
 * @date 2020-12-02 18:31:32
 */
@Validated
@RestController
@RequestMapping("/platform/merchantsofsupplyapply")
@Api(tags = "商户向供应商申请商品表")
public class MerchantsOfSupplyApplyController{

    @Autowired
    private MerchantsOfSupplyApplyService merchantsOfSupplyApplyService;


    @ApiOperation("商户向供应商申请商品表列表查询")
    @GetMapping("/list")
    public ResultUtil aopMerchantsOfSupplyApplyList(@CApiParam(name = "page",value = "页数",required = true,cNotEmpty = true,cIntMin = 1) @RequestParam("page") Integer page,
                              @CApiParam(name = "limit",value = "每页个数",required = true,cNotEmpty = true,cIntMin = 1) @RequestParam("limit") Integer limit,
                              @CApiParam(name = "conditions",value = "查询条件",required = false) @RequestParam("conditions") String conditions){
        return merchantsOfSupplyApplyService.MerchantsOfSupplyApplylist(page, limit, conditions);
    }


    @ApiOperation("根据ID查询merchantsOfSupplyApply实体")
    @GetMapping("/getMerchantsOfSupplyApplyById")
    public ResultUtil GetMerchantsOfSupplyApplyById(@CApiParam(name = "id",value = "merchantsOfSupplyApply实体ID",required = true,cNotEmpty = true) @RequestParam("id") Long id){
        return merchantsOfSupplyApplyService.getMerchantsOfSupplyApplyById(id);
    }


    @ApiOperation("新增merchantsOfSupplyApply实体")
    @PostMapping("/add")
    @ApiOperationSupport(ignoreParameters = {"merchantsOfSupplyApply.id","merchantsOfSupplyApply.createTime","merchantsOfSupplyApply.updateTime","merchantsOfSupplyApply.deleteFlag"})
    public ResultUtil aopAddMerchantsOfSupplyApply(@RequestBody @Validated MerchantsOfSupplyApply merchantsOfSupplyApply){
        return merchantsOfSupplyApplyService.addMerchantsOfSupplyApply(merchantsOfSupplyApply);
    }

    @ApiOperation("编辑merchantsOfSupplyApply实体")
    @PostMapping("/edit")
    @ApiOperationSupport(ignoreParameters = {"merchantsOfSupplyApply.createTime","merchantsOfSupplyApply.updateTime","merchantsOfSupplyApply.deleteFlag"})
    public ResultUtil aopEditMerchantsOfSupplyApply(@RequestBody @Validated MerchantsOfSupplyApply merchantsOfSupplyApply){
        return merchantsOfSupplyApplyService.editMerchantsOfSupplyApply(merchantsOfSupplyApply);
    }

    @ApiOperation("根据ID删除merchantsOfSupplyApply实体")
    @GetMapping("/delMerchantsOfSupplyApplyById")
    public ResultUtil aopDelMerchantsOfSupplyApplyById(@CApiParam(name = "id",value = "merchantsOfSupplyApply实体ID",required = true,cNotEmpty = true) @RequestParam("id") Long id){
        return merchantsOfSupplyApplyService.delMerchantsOfSupplyApplyById(id);
    }

}






